<?php

namespace Yearnfar\Bundle\BlogBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Yearnfar\Bundle\BlogBundle\Exception\ShowMsgException;

class BaseController extends Controller
{


    public function showMsg($msg, $url='', $time=3, $class='')
    {
        if (!$url) $url = getenv("HTTP_REFERER") ? getenv("HTTP_REFERER") : '/';

        throw new ShowMsgException('', array('msg'=>$msg,'url'=>$url,'time'=>$time, 'class'=>$class));
    }
}